/**
 * 查询患者信息，并将结果记录到缓存
 * 跳转到页面，必须有hzid参数
 */
function HzxxQuery(phone){
    phone =  phone || $.QuickUrlUtils.getRequest("phone");
    var idCard = $.QuickUrlUtils.getRequest("sfzh");

    var uri_service_queryItem = '/api/ysd/hzcz/queryItem'
    this.init = function(callback){
        if (phone && idCard) {
            $.QuickRemote.AjaxJson({
                funcName : uri_service_queryItem,
                params : {
                    sjhm : phone,
                    sfzh : idCard
                },
                callback : function(result) {
                    if (result) {
                        StoreCache.setCache("ysdHzInfo", result);
                        StoreCache.setCache("jkcsUserInfo", result);
                        if($.isFunction(callback)){
                            callback();
                        }
                    } else {
                        $.QuickAlert.alertFail({
                            content: "查询患者信息失败,该患者不是此app上的注册用户",
                            callback : function() {
                                // $.pageSwitch.goToUrl("selfCenter", "wdhz", "", {animate : "pop"});
                                $.QuickUrlUtils.reBackAndRefreshJSBridge("");
                            }
                        });
                    }
                    
                }
            });
        } else {
            $.QuickAlert.alertFail({content: "查询患者信息失败，请求参数中没有phone"});
        }
    }
    return this;
}
